#define _CRT_SECURE_NO_WARNINGS 1

//1000007
#include<stdio.h>
int a[101] = { 0 }, arr[101][101] = { 0 };
int main()
{
	int n = 0, m = 0;
	arr[0][0] = 1;
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
	{
		for (int j = 0; j <= m; j++)
		{
			for (int t = 0; t <= a[i]; t++)
			{
				if (t <= j)
				{
					arr[i][j] += arr[i - 1][j - t];
					arr[i][j] %= 1000007;
				}
			}
		}
	}
	printf("%d", arr[n][m]);
	return 0;
}